#include <iostream>
using namespace std;
class Flyable{
public:
    virtual void takeoff() = 0;
    virtual void land()=0;
};
class Plane:public Flyable{
private:
    string mcode;
public:
    Plane(string code){
        mcode = code;
    };
    virtual void takeoff(){
        cout<<"Plane Take Off"<<"\n";
    };
    virtual void land(){
        cout<<"Plane Land On"<<"\n";
    };
    void printCode(){
        cout<<mcode<<"\n";
    };
};
class FighterPlane:public Plane
{
private:
public:
    FighterPlane(string code):Plane(code){

};
    virtual void takeoff(){
        cout<<"FighterPlane Take Off"<<"\n";
    };
    virtual void land(){
        cout<<"FighterPlane Land On"<<"\n";
    };

};

void flyMatch(Flyable *f1,Flyable *f2)
{
    f1->takeoff();
    f1->land();
    f2->takeoff();
    f1->land();
}
//接口类只有纯虚函数其它都没有
int main() {
    FighterPlane p1("001");
    FighterPlane p2("002");
    p1.printCode();
    p2.printCode();
    flyMatch(&p1,&p2);
    return 0;
}